package com.kdtech.crawler;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 抓取到的url的原始元数据* 
 * @author kk
 */
public class HttpMetaData implements Serializable{
	private String url;
	private String html;
	private Map<String,String> httpHeaders;
	private long contentLength;
	private int statusCode;//
	private String encoding;//
	private long respondTimes;//响应时间 单位ms
	private Long lastModifiedDate;
	private Long expireTime;
	public String getHtml() {
		return html;
	}
	public void setHtml(String html) {
		this.html = html;
	}
	public Map<String, String> getHttpHeaders() {
		if (httpHeaders == null){
			httpHeaders = new HashMap<String, String>();
		}
		return httpHeaders ;
	}
	public void setHttpHeaders(Map<String, String> httpHeaders) {
		this.httpHeaders = httpHeaders;
	}
	public long getContentLength() {
		return contentLength;
	}
	public void setContentLength(long contentLength) {
		this.contentLength = contentLength;
	}
	public int getStatusCode() {
		return statusCode;
	}
	public void setStatusCode(int statusCode) {
		this.statusCode = statusCode;
	}
	public String getEncoding() {
		return encoding;
	}
	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}
	
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public long getRespondTimes() {
		return respondTimes;
	}
	public void setRespondTimes(long respondTimes) {
		this.respondTimes = respondTimes;
	}
	@Override
	public String toString() {
		return "HttpMetaData [ html=" + html + ",\ncontentLength=" + contentLength + ", \nencoding="
				+ encoding + ", \nhttpHeaders=" + httpHeaders
				+ ", \nstatusCode=" + statusCode +   ",\nrespondTimes="+respondTimes+"]";
	}
	public Long getLastModifiedDate() {
		return lastModifiedDate;
	}
	public void setLastModifiedDate(Long lastModifiedDate) {
		this.lastModifiedDate = lastModifiedDate;
	}
	public Long getExpireTime() {
		return expireTime;
	}
	public void setExpireTime(Long expireTime) {
		this.expireTime = expireTime;
	}
	
	
	
	
	
	
	
}
